<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var num = 0;
		var arr = [4, 0, 7, 9, 0, 0, 2, 6, 0, 3, 1, 0];
		function fun (arr,val) {
			for(var i = 0; i < arr.length; i ++) {
    			if(arr[i] == val) {
      				arr.splice(i,1);
      				i --;
    			}
  			}
		}
		fun (arr,0);
		console.log(arr);
    </script>
</head>
<body>
    
</body>
</html>